package com.wmh.baseservice.admin.convert.admin;

import cn.hutool.core.collection.CollUtil;
import com.wmh.baseservice.admin.entity.AdRoleRobotTask;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author 谢骏
 * @date 2023/11/7 10:25
 **/
@Mapper
public interface AdRoleRobotConvert {

    AdRoleRobotConvert INSTANCE = Mappers.getMapper(AdRoleRobotConvert.class);

    AdRoleRobotTask convert(Long roleId, Long taskId);

    default List<AdRoleRobotTask> convertList(Long roleId, List<Long> taskIds) {
        return CollUtil.map(taskIds, taskId -> this.convert(roleId, taskId), true);
    }
}
